<% content_for :content do %>
<div id="main_body">
 	<div class="index_show">
  <% if advertise = Doing.advertise_banners.first %>
	<a href="<%=advertise.src%>" target="_blank">
		<%= image_tag advertise.cover.url, style: "position:absolute;z-index:999;", width: "1290", height: "480", id: "advertise_pic" %>
	</a>
 	<% end %>
 	<a class="show_1" href="#nogo" style='position: relative'>
 		<% if Doing.left_banners.present? %>
 			<% left_banner = Doing.left_banners.last %>
	 		<%= image_tag Doing.left_banners.last.cover.url(:small), onclick: "document.location = '#{left_banner.src}'" %>
			<span class="zzjs" style='<%= gender_css(Doing.left_banners.last) %>'>
			<%= Doing.left_banners.last.name %></span>
 		<% end %>
	</a>
	<% if Doing.video_banners.present? %>
	 	<video class="index_s at_cl_vedio video-js vjs-default-skin"
					  controls preload="auto" width="421" height="480"
					  poster="<%= Doing.video_banners.last.cover.url(:video) if Doing.video_banners.present? %>"
					  data-setup='{"example_option":true}'>
					<% Doing.video_banners.each do |video_banner| %>
						<% if video_banner.src.present? %>
							<source src="<%= video_banner.src %>" type='video/mp4' />
						<% else %>
							<source src="<%= video_banner.video_path %>" type='video/mp4' />
						<% end %>
			 		<% end %>
		</video>
	  <span class="zzjx"><%= Doing.video_banners.last.name %></span>
  <% elsif Doing.flash_banners.present? %>
		<% if Doing.flash_banners.first.present? %>
			<object width="400" height="480" data="<%= Doing.flash_banners.first.src %>"></object>
		<% else %>
			<object width="400" height="480" data="<%= Doing.flash_banners.first.video %>"></object>
		<% end %>
  <% end %>			
	<a class="show_1" href="#nogo" style='position: relative'>
		<% if Doing.right_banners.present? %>
			<% right_banner = Doing.right_banners.last %>
      <%= image_tag Doing.right_banners.last.cover.url(:small), onclick: "document.location = '#{right_banner.src}'" %>
	   	<span class="zzj" style='<%= gender_css(Doing.right_banners.last)%>'><%= Doing.right_banners.last.name %></span>
		<% end %>
	</a>
 	</div>


  <div class="lei row" id="tags">

				<div class="btn-group tags" style="width:33.3%;">
		      	<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" style="border: none;background: none;">
	            <span><%= link_to image_tag(@hotel_img, size: "159x26").html_safe, list_articles_path(category: "酒店") %></span>
          	</button>
	          <ul class="dropdown-menu">
							<% @hotes_tags.each do |tag| %>
								<%= link_to list_articles_path(category: "酒店", tag: tag)  do %>
									<li class='widen_out'><%= tag %></li>
								<% end %>
							<% end %>
	          </ul>
		    </div>

 				<div class="btn-group tags" style="width:33.3%;">
		      	<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" style="border: none;background: none;">
	            <span><%= image_tag @video_img %></span>
          	</button>
	          <ul class="dropdown-menu">
								<% @videos_tags.each do |tag| %>
									<a><li class='widen_out' ><%=tag%></li></a>
								<% end %>
	           </ul>
		    </div>  

				<div class="btn-group tags">
		      	<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" style="border: none;background: none;">
	            <span><%= image_tag @new_img %></span>
          	</button>
	          <ul class="dropdown-menu">
							<% @news_tags.each do |tag| %>
								<%= link_to list_articles_path(category: "咨询", tag: tag) do %>
									<li class='widen_out'><%= tag %></li>
								<% end %>
							<% end %>
	           </ul>
		    </div>

 	</div>


  <div class="body_half">
		<div id="focus"></div>

		<div id="what_tag">
			<div class="btn-group" style="margin-left:35%;">
	      	<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" style="border: none;background: none;">
	          <span><%= image_tag @what_img %></span>
	      	</button>
	        <ul class="dropdown-menu">
							<% @doing_tags.each do |tag| %>
								<%= link_to list_products_path(category: "去干吗", tag: tag) do %>
									<li class='widen_out'><%= tag %></li>
								<% end %>	
							<% end %>
	         </ul>
	    </div>
		</div>


		<%= javascript_include_tag "swfobject", "data-turbolinks-track" => true %>
		<script type="text/javascript">
			var pics = "";
			var links = "";
			var texts = ""; 
			<% left_lamps = Lamp.where(position: "左").all %>
			<% left_lamps.each_with_index do |lamp,index| %>
				pics += "<%= lamp.cover.url(:small) %>";
				links += "<%= lamp.lamp_url %>";
				texts += "<%= lamp.name %>";
				<% if index < left_lamps.size - 1 %>
					pics += "|";
					links += "|";
					texts += "|";				
				<% end %>
			<% end %>

			var so = new SWFObject("/assets/wheel.swf", "focus", "440", "220", "7", "#ffffff");
			so.addParam('wmode','transparent');
			so.addVariable("picurl",pics);
			so.addVariable("pictext",texts);
			so.addVariable("piclink",links);
			so.addVariable("pictime","3");
			so.addVariable("borderwidth","264");
			so.addVariable("borderheight","352");
			so.addVariable("borderw","true");
			so.addVariable("buttondisplay","true");
			so.addVariable("textheight","1");
			so.write("focus");

			$("button.dropdown-toggle").click(function(){
				var href = $(this).find('a').attr('href')
				if(href)
					window.location.href=href;
			})

		</script>
	</div>
	<div  class="cut body_half">
		<div id="focus_2"></div>

		<div id="where_tag">
			<div class="btn-group" style="margin-left:30%;">
	      	<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" style="border: none;background: none;">
	          <span><%= image_tag @where_img %></span>
	      	</button>
	        <ul class="dropdown-menu">
							<% @where_tags.each do |tag| %>
								<%= link_to list_products_path(category: "去哪里", tag: tag)  do %>
									<li class='widen_out'><%= tag %></li>
								<% end %>
							<% end %>
	         </ul>
	    </div>
		</div>

		
   	<script type="text/javascript">
   		var pics = "";
			var links = "";
			var texts = ""; 

			<% right_lamps = Lamp.where(position: "右").all %>
			<% right_lamps.each_with_index do |lamp,index| %>
				pics += "<%= lamp.cover.url(:small) %>";
				links += "<%= lamp.lamp_url %>";
				texts += "<%= lamp.name %>";
				<% if index < right_lamps.size - 1 %>
					pics += "|";
					links += "|";
					texts += "|";				
				<% end %>
			<% end %>

			var so = new SWFObject("/assets/wheel.swf", "focus_2", "440", "220", "7", "#ffffff");
			so.addParam('wmode','transparent');
			so.addVariable("picurl",pics);
			so.addVariable("pictext",texts);
			so.addVariable("piclink",links);
			so.addVariable("pictime","3");
			so.addVariable("borderwidth","164");
			so.addVariable("borderheight","252");
			so.addVariable("borderw","true");
			so.addVariable("buttondisplay","true");
			so.addVariable("textheight","1");
			so.write("focus_2");
		</script>
 	</div>
</div>

<script type="text/javascript">
	$(document).ready(function(){
		setTimeout(navClose,5000);
	});

	function navClose() {
		if($("#advertise_pic"))
			$("#advertise_pic").hide();
	}
</script>

<% end %>